include_directories(.)

find_package(Qt5 REQUIRED COMPONENTS Test)

macro(add_simple_test TEST_NAME)
    add_executable(tst_${TEST_NAME} ${TEST_NAME}/tst_${TEST_NAME}.cpp)
    add_test(tst_${TEST_NAME} tst_${TEST_NAME})
    target_link_libraries(tst_${TEST_NAME} Qt5::Test qxmpp)
endmacro()

include_directories(${PROJECT_SOURCE_DIR}/src/base)
include_directories(${PROJECT_SOURCE_DIR}/src/client)
include_directories(${PROJECT_SOURCE_DIR}/src/server)
include_directories(${PROJECT_BINARY_DIR}/src/base)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_simple_test(qxmpparchiveiq)
add_simple_test(qxmppbindiq)
add_simple_test(qxmppbitsofbinarycontentid)
add_simple_test(qxmppbitsofbinaryiq)
add_simple_test(qxmppcallmanager)
add_simple_test(qxmppcarbonmanager)
add_simple_test(qxmppclient)
add_simple_test(qxmppdataform)
add_simple_test(qxmppdiscoveryiq)
add_simple_test(qxmppentitytimeiq)
add_simple_test(qxmpphttpuploadiq)
add_simple_test(qxmppiceconnection)
add_simple_test(qxmppiq)
add_simple_test(qxmppjingleiq)
add_simple_test(qxmppmammanager)
add_simple_test(qxmppmixitem)
add_simple_test(qxmppmessage)
add_simple_test(qxmppmessagereceiptmanager)
add_simple_test(qxmppmixiq)
add_simple_test(qxmppnonsaslauthiq)
add_simple_test(qxmpppresence)
add_simple_test(qxmpppubsubiq)
add_simple_test(qxmppregisteriq)
add_simple_test(qxmppregistrationmanager)
add_simple_test(qxmppresultset)
add_simple_test(qxmpprosteriq)
add_simple_test(qxmpprpciq)
add_simple_test(qxmpprtcppacket)
add_simple_test(qxmpprtppacket)
add_simple_test(qxmppserver)
add_simple_test(qxmppsessioniq)
add_simple_test(qxmppsocks)
add_simple_test(qxmppstanza)
add_simple_test(qxmppstarttlspacket)
add_simple_test(qxmppstreamfeatures)
add_simple_test(qxmppstunmessage)
add_simple_test(qxmppvcardiq)
add_simple_test(qxmppversioniq)

if(BUILD_INTERNAL_TESTS)
    add_simple_test(qxmppcodec)
    add_simple_test(qxmppsasl)
    add_simple_test(qxmppstreaminitiationiq)
endif()

add_subdirectory(qxmpptransfermanager)
add_subdirectory(qxmpputils)
add_subdirectory(qxmppuploadrequestmanager)

